Reasoning about Multi-stage Programs

نویسندگان

  • Jun Inoue
  • Walid Taha
چکیده

We settle three basic questions that naturally arise when verifying multi-stage functional programs. Firstly, does adding staging to a language compromise any equalities that hold in the base language? Unfortunately it does, and more care is needed to reason about terms with free variables. Secondly, staging annotations, as the name “annotations” suggests, are often thought to be orthogonal to the behavior of a program, but when is this formally guaranteed to be true? We give termination conditions that characterize when this guarantee holds. Finally, do multi-stage languages satisfy useful, standard extensional facts, for example that functions agreeing on all arguments are equivalent? We provide a sound and complete notion of applicative bisimulation, which establishes such facts or, in principle, any valid program equivalence. These results greatly improve our understanding of staging, and allow us to prove the correctness of quite complicated multi-stage programs.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

A Sound Reduction Semantics for Untyped Cbn Multi-stage Computation. Or, the Theory of Metaml Is Non-trivial (preliminary Report)

MetaML is a programming language that provides a good formalism for expressing multi-stage computation. Deening a reduction semantics for MetaML has been an illusive challenge. This paper presents a sound and strikingly simple reduction semantics for CBN MetaML that avoids the complexities and pitfalls of the previously proposed notion of \level-annotated terms". The novelty of this reduction s...

متن کامل

Reasoning Agents in Dynamic Domains

The paper discusses an architecture for intelligent agents based on the use of A-Prolog-a language of logic programs under the answer set semantics. A-Prolog is used to represent the agent's knowledge about the domain and to formulate the agent's reasoning tasks. We outline how these tasks can be reduced to answering questions about properties of simple logic programs and demonstrate the method...

متن کامل

Multi-agent Abductive Reasoning with Confidentiality (Extended Abstract)

In the context of multi-agent hypothetical reasoning, agents typically have partial knowledge about their environments, and the union of such knowledge is still incomplete to represent the whole world. Thus, given a global query they need to collaborate with each other to make correct inferences and hypothesis, whilst maintaining global constraints. There are many real world applications in whi...

متن کامل

Multi-level Debugging for Multi-stage, Parallelizing Compilers

A multi-stage compilation framework transforms portions of programs written in a productivity-level language into an efficiency-level language, such as C, with explicit hardwarespecific optimizations. It is challenging for compiler programmers to debug errors in the compilation because they must perform complicated end-to-end reasoning, relating the programs across the multiple stages of compil...

متن کامل

Reasoning about Multi-process Systems with the Box Calculus

The box calculus is a formalism for reasoning about the properties of multi-process systems which enables account to be taken of pragmatic as well as computational concerns. It was developed for the programming language Hume which explicitly distinguishes between coordination, based on concurrent boxes linked by wires, and expressions, based on polymorphic recursive functions. This chapter intr...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:
  • J. Funct. Program.

دوره 26  شماره 

صفحات  -

تاریخ انتشار 2012